﻿-- =============================================
-- Author:		<赵洪涛>
-- Create date: <2014-10-14>
-- Description:	<获取重复的助记词数量(新客户审核)>
-- =============================================
CREATE PROCEDURE [dbo].[proc_Customer_ReptMWCount]
(
	@MnemonicWorks nvarchar(100),
	@CusId varchar(60),
	@CompanyId int
)
AS
BEGIN
	Declare @cSql nvarchar(2000)

	If @MnemonicWorks<>''
	Begin
		Set @cSql = 'Select Count(0) As shl From Customer
		Where CompanyId='+Convert(varchar(10),@CompanyId)+' And Audit=1
		And	(CustomerName Like ''%'+@MnemonicWorks+'%''
		Or MnemonicWorks='''+@MnemonicWorks+''')'

		Exec(@cSql)
	End
	Else
		Select -1 As shl
END